Programming Using Color

Color can be used to edit a terrain. Color can also be used to control how breeds interact with colored terrain.

Example 1: If a breed is on green, the breed dies.

Example 2: If a breed is on red, add 2 points to score.

Example 3: If a breed has blue in front of it, breed turns right a random number between 135-225 degrees.

Example 4: If a breed is on yellow, breeds speed is increased to 4.

Example 5: If a breed is on magenta, set size to 3.

You can use as many colors for painting your terrain but you will need to know the color's characteristics to use it to effect your breeds in your programming.


Using Standard Colors

When using standard colors for programming, make sure the values of the RGB (amount of Red, Green, and Blue) for the color match when choosing your programming colors to paint.

RGB_color_sliders.jpg
RBG_Set_Colors.jpgRGB_Table.jpg

Using Non Standard Colors

If you want to use the non-standard colors, you can use the color number that every color is assigned in Starlogo TNG. To determine the color, you need to create a Forever Block where the breed will say the color it is standing on as it moves around Spaceland.

When you find out the number, you will be able to use the color in your programming. The image below shows you the two Forever Blocks.

The first Forever Block shows how to determine the color's number with the second using the color number in a program.


RGB_Not_Set_Colors.jpg